<?php

	header('Content-Type: text/html; charset=UTF-8');


	include './include/conf.php';

	
	$nomCateg = $_POST['nomCateg'];
	
	$tabReponse = array();
	$donnees = array();
	
	$selectinformations =$pdo->prepare('select i.*,concat(a.prenom," ",a.nom) as auteur from information i,adherent a where a.id_adherent = i.auteur and id_categorie = (select id_categorie from categorie where nom ="'.$nomCateg.'");');
	$selectinformations->execute();
	while($informations =  $selectinformations->fetch())
	{
		//echo $informations;
		$donnees[] = $informations;
	}
	
	$selectinformations->closeCursor();
	$tabReponse['informations'] = $donnees;
	
	echo json_encode($tabReponse);
	
?>